package nuc.widget;

import nuc.SQLoperation.Constant;
import nuc.wy.SimpleNote;
import android.database.Cursor;

public class Parse {
	public static SimpleNote parseCursor(Cursor cursor){
		
        if (null == cursor || 0 == cursor.getCount()) {
            return null;
        } else if ( -1 == cursor.getPosition() ) {
            cursor.moveToFirst();
        }
		SimpleNote note = new SimpleNote();
		note.id = cursor.getString(cursor.getColumnIndex(Constant.ID));
		note.title = cursor.getString(cursor.getColumnIndex(Constant.title));
		note.content = cursor.getString(cursor.getColumnIndex(Constant.content));
		note.photoURL = cursor.getString(cursor.getColumnIndex(Constant.photoURL));
		note.lastdata = cursor.getLong(cursor.getColumnIndex(Constant.lastdate));
		return note;
	}
}
